<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Void</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="language.types.mixed.html">« Mixed</a></li>
      <li style="float: right;"><a href="language.types.never.html">Never »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="language.types.html">类型</a></li>
    <li>Void</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="language.types.void" class="sect1">
 <h2 class="title">Void</h2>

 <p class="para">
  <span class="type"><span class="type void">void</span></span> 是仅用于返回类型，表示函数不返回值，但该函数扔可能会终止。因此，它不能成为<a href="language.types.type-system.html#language.types.type-system.composite.union" class="link">联合类型</a>声明的一部分。自 PHP 7.1.0 起可用。
 </p>

 <blockquote class="note"><p><strong class="note">注意</strong>: 
  <span class="simpara">
   即使函数的返回类型是 <span class="type"><span class="type void">void</span></span>，但仍然可以返回值，但值只能始终为 <strong><code>null</code></strong>。
  </span>
 </p></blockquote>

</div></div></div></body></html>